<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:dt="http://java.sun.com/jsf/composite/components"
                template="./../adminTemplate.xhtml">

    <ui:define name="content">
        <dt:changeStudent action="/admin/student/editStudent" />
        <h:form>
            <h:panelGrid id="editStudentPanel" columns="3">
                <f:facet name="header">
                    <h:outputText value="#{bundle['student.edit.form.title']} #{adminManager.currentStudent.name}" />
                </f:facet>
                <h:outputLabel for="firstName" value="#{bundle['person.firstName']}:" />
                <h:inputText id="firstName" value="#{adminManager.currentStudent.firstName}" />
                <h:message for="firstName" style="color: red"/>
                <h:outputLabel for="middleName" value="#{bundle['person.middleName']}:" />
                <h:inputText id="middleName" value="#{adminManager.currentStudent.middleName}" />
                <h:message for="middleName" style="color: red"/>
                <h:outputLabel for="lastName" value="#{bundle['person.lastName']}:" />
                <h:inputText id="lastName" value="#{adminManager.currentStudent.lastName}" />
                <h:message for="lastName" style="color: red"/>
                <h:outputLabel for="nickName" value="#{bundle['person.nickName']}:" />
                <h:inputText id="nickName" value="#{adminManager.currentStudent.nickname}" />
                <h:message for="nickName" style="color: red"/>
                <h:outputLabel for="suffix" value="#{bundle['person.suffix']}:" />
                <h:inputText id="suffix" value="#{adminManager.currentStudent.suffix}" />
                <h:message for="suffix" style="color: red"/>
                <h:outputLabel for="school" value="#{bundle['student.school']}:" />
                <h:inputText id="school" value="#{adminManager.currentStudent.school}" />
                <h:message for="school" style="color: red" />
                <h:outputLabel for="grade" value="#{bundle['student.grade']}:" />
                <h:selectOneMenu id="grade" value="#{adminManager.currentStudent.grade}">
                    <f:selectItem itemLabel="-Select One-" itemValue="None selected" />
                    <f:selectItems value="#{adminManager.allGrades}" />
                </h:selectOneMenu>
                <h:message for="grade" style="color: red" />
                <h:outputLabel for="email" value="#{bundle['person.email']}:" />
                <h:inputText id="email" value="#{adminManager.currentStudent.email}" />
                <h:message for="email" style="color: red"/>
                <h:outputLabel for="homePhone" value="#{bundle['person.homePhone']}:" />
                <h:inputText id="homePhone" value="#{adminManager.currentStudent.homePhone}" />
                <h:message for="homePhone" style="color: red"/>
                <h:outputLabel for="mobilePhone" value="#{bundle['person.mobilePhone']}:" />
                <h:inputText id="mobilePhone" value="#{adminManager.currentStudent.mobilePhone}" />
                <h:message for="mobilePhone" style="color: red"/>                        <f:facet name="footer">
                    <h:panelGroup style="display:block; text-align:center">
                        <h:commandButton id="submit"
                                         action="#{adminBean.editStudent(adminManager.currentStudent)}"
                                         value="#{bundle['action.submit']}" />
                        <h:commandButton id="cancel"
                                         action="/admin/index"
                                         immediate="true"
                                         value="#{bundle['action.cancel']}" />
                    </h:panelGroup>
                </f:facet>
            </h:panelGrid>
        </h:form>

    </ui:define>

</ui:composition>

